The present invention relates to a line generating method suitable for a graphic display apparatus for displaying a line in accordance with a main line and a sub-line which have complementary luminance intensities.
In a conventional raster scan type graphic display apparatus, a step is formed between displayed dots of an oblique line, and a saw-tooth line becomes noticeable.
In order to overcome this drawback, a conventional method is proposed wherein an oblique line is displayed in accordance with a multi-level density. FIG. 1 shows a line generator to which this method is applied. A digital differential analyzer (hereinafter referred to as a DDA) 11 has a known arrangement wherein coordinates (x,y), given as interpolated points by performing interpolation using a start point (x.sub.O,y.sub.O) and an end point (x.sub.m,y.sub.m), are generated starting from the start point. The DDA 11 adopts the Bresenham's algorithm which is in widespread use. The coordinate data generated by the DDA 11 are used to display a main line. As shown in FIG. 2, when a slope .DELTA.y/.DELTA.x of the line (ideal line obtained by connecting the start point and the end point) falls within an angle of 45.degree. (.DELTA.y/.DELTA.x.ltoreq.1), the DDA 11 is operated in the following manner in accordance with the Bresenham's algorithm. The coordinate along the y-axis is increased by .DELTA.y/.DELTA.x every time the coordinate along the x-axis is increased by one dot. As a result, when the y coordinate exceeds (the preceding y coordinate+1), the y coordinate is regarded as being increased by one dot (i.e., one lattice line segment). The DDA 11 generates an absolute value (to be referred to as an absolute difference) "d" of a difference between the actual value as a result of increment operation and the y coordinate of the interpolated point (x,y) of the main line. On the other hand, when the condition .DELTA.y/.DELTA.x&gt;1 (45.degree. or more) is established, the DDA 11 reverses the x- and y-axes, and performs the above operation in accordance with the Bresenham's algorithm. The coordinate along the y-axis is increased by one dot from the start point. Every time the coordinate along the y-axis is increased by one dot, the coordinate along the x-axis is increased by .DELTA.x/.DELTA.y. When the x coordinate exceeds (the preceding x coordinate+1), the x coordinate is regarded as being increased by one dot (i.e., one lattice line segment). In this case, the absolute difference "d" is an absolute value of a difference between the actual value as a result of an increase and the y coordinate of the interpolated point (x,y) of the main line.
The absolute difference d generated by the DDA 11 is supplied to an intensity modulation circuit 12. The intensity modulation circuit 12 generates intensity information (e.g., two-bit data) 17 indicating an intensity in accordance with the absolute difference "d".
The relationship between the absolute difference "d" and the intensity information 17 is shown in Table 1.
TABLE 1 ______________________________________ d Intensity information 17 Intensity level ______________________________________ d &lt; 0.25 "11" 4 0.25 .ltoreq. d &lt; 0.5 "10" 3 0.5 .ltoreq. d &lt; 0.75 "01" 2 0.75 .ltoreq. d &lt; 1.0 "00" 1 ______________________________________
The intensity level in Table 1 indicates the degree of intensity. For example, level 4 indicates an intensity four times that of level 1.
Pieces of intensity information 17 corresponding to the coordinates (x,y) of the interpolated points of the main line which are sequentially generated from the DDA 11 are generated from the intensity modulation circuit 12. The main line is displayed by using these pieces of intensity information 17, as shown in FIG. 2. Referring to FIG. 2, numerals within displayed dots indicate intensity levels, respectively.
Data of the coordinates (x,y) 18 of each main line point is also supplied to a sub-line coordinates generator 13. An upper/right movement designating signal 16 for indicating the upper/right movement in accordance with an absolute value .vertline..DELTA.y/.DELTA.x.vertline. of the slope of an ideal line A is supplied from a microprocessor 15 to the sub-line coordinates generator 13. When the signal 16 indicates upward movement (e,g. when .vertline..DELTA.y/.DELTA.x.vertline..ltoreq.1 is given or an angle is within 45.degree.), the sub-line coordinates generator 13 increases the y coordinate of the main line point (x,y) 18 by +1 and generates data of coordinates (x,y+1) as coordinates (x',y') of a sub-line point 19. Similarly, when the signal 16 indicates rightward movement (e.g., when the abosolute value .vertline..DELTA.y/.DELTA.x.vertline.&gt;1 is given or the angle exceeds 45.degree.), the sub-line coordinates generator 13 increases the x coordinate of the main line point (x,y) 18 by +1 and generates data of coordinates (x+1,y) as the coordinates (x',y') of a sub-line point 19. The two-bit intensity information 17 for the main line which is generated from the intensity modulation circuit 12 is supplied to an inverter 14 so as to invert the level of the sub-line information. As a result, the inverter 14 generates intensity information 17' for the sub-line. The data 19 of coordinates (x',y') which are sequentially generated from the sub-line coordinates generator 13 and the sub-line intensity information generated by the inverter 14 are used to display the sub-line shown in FIG. 2. In this case, the intensities of the main line and the sub-line are complementary. A sum of the intensity of any given main line dot and that of a corresponding sub-line dot is constant. In this manner, when a single line is displayed by using both the main line and the sub-line, a smooth oblique line can be observed by an operator.
Assume that a polygonal line consisting of a line with a slope of less than 45.degree. and a line with a slope of more than 45.degree. is generated by the line generator shown in FIG. 1, as is apparent from the above description, a main line and a sub-line are obtained, as shown in FIG. 3. In this case, the main line and the sub-line are not observed separately by the operator on the display screen. As shown in FIG. 4, the main line and the sub-line are observed as a single polygonal line.
However, according to the conventional line generating method, a distortion occurs at a bent portion between a line with a slope of less than 45.degree. and a line with a slope of more than 45.degree.. In particular, when a circle or arc is drawn by a polygon or polygonal line, misalignment as shown in FIG. 5 occurs, resulting in inconvenience.